<%@ page import="buscar.Financiamento"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="layout" content="main" />
<g:set var="entityName"
	value="${message(code: 'financiamento.label', default: 'Financiamento')}" />
<title><g:message code="default.simulate.label"
		args="[entityName]" /></title>
</head>
<body>
	<div class="nav">
		<span class="menuButton"><a class="home"
			href="${createLink(uri: '/')}"><g:message
					code="default.home.label" /> </a> </span> <span class="menuButton"><g:link
				class="list" action="list">
				<g:message code="default.list.label" args="[entityName]" />
			</g:link> </span>
	</div>
	<div class="body">
		<h1>
			<g:message code="default.simulate.label" args="[entityName]" />
		</h1>
		<g:if test="${flash.message}">
			<div class="message">
				${flash.message}
			</div>
		</g:if>
		<g:if test="${financiamentoInstance.hasErrors()}">
			<div class="errors">
				<g:renderErrors bean="${financiamentoInstance}" as="list" />
			</div>
		</g:if>
		<g:form action="simule">
			<div class="dialog">
				<table>
					<tbody>
						<tr class="prop">
							<td valign="top" class="name"><label for="marca"><g:message
										code="financiamento.marca.label" default="Marca" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: financiamentoInstance, field: 'marca', 'errors')}">
								<g:select name="marca" from="${['','Fiat','Renault','Ford'] }"
									value="${financiamentoInstance?.marca}" />
							</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="modelo"><g:message
										code="financiamento.modelo.label" default="Modelo" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: financiamentoInstance, field: 'modelo', 'errors')}">
								<g:textField name="modelo" maxlength="50"
									value="${financiamentoInstance?.modelo}" />
							</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="ano"><g:message
										code="financiamento.ano.label" default="Ano" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: financiamentoInstance, field: 'ano', 'errors')}">
								<g:datePicker name="ano" value="${financiamentoInstance?.ano}"
									precision="year" years="${1950..2012}" />
							</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="valorVeiculo"><g:message
										code="financiamento.valorVeiculo.label"
										default="Valor Veiculo" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: financiamentoInstance, field: 'valorVeiculo', 'errors')}">

								<g:textField name="valorVeiculo"
									value="${fieldValue(bean: financiamentoInstance, field: 'valorVeiculo')}" />

							</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="valorEntrada"><g:message
										code="financiamento.valorEntrada.label"
										default="Valor Entrada" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: financiamentoInstance, field: 'valorEntrada', 'errors')}">
								<g:textField name="valorEntrada"
									value="${fieldValue(bean: financiamentoInstance, field: 'valorEntrada')}" />
							</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="parcela"><g:message
										code="financiamento.parcela.label" default="Parcela" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: financiamentoInstance, field: 'parcela', 'errors')}">
								<g:textField name="parcela"
									value="${fieldValue(bean: financiamentoInstance, field: 'parcela')}" />
							</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="cpf"><g:message
										code="financiamento.cpf.label" default="Cpf" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: financiamentoInstance, field: 'cpf', 'errors')}">
								<g:textField name="cpf" value="${financiamentoInstance?.cpf}" />
							</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="estado"><g:message
										code="financiamento.estado.label" default="Estado" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: financiamentoInstance, field: 'estado', 'errors')}">
								<g:select name="estado" from="${estados}" optionKey="sigla"
									optionValue="nome" value="${financiamentoInstance?.estado}" />
							</td>
						</tr>

					</tbody>
				</table>
			</div>
			<div class="buttons">
				<span class="button"><g:submitButton name="Simular"
						class="save" value="Simular" /> </span>
			</div>
		</g:form>
	</div>
</body>
</html>
